import { Injectable } from '@nestjs/common';
import { InwuRequestApiService } from '../inwu-request.service';

@Injectable()
export class InwuAuthService {

    constructor(private inwuRequestApiService: InwuRequestApiService,
    ) { }

    /**
     * 第三方登录
     * @param params 
     */
    public login(params: any) {
        return this.inwuRequestApiService.post('/api/auth/login', params);
    }

    /**
     * 获取用户信息
     * @param params 
     */
    public getUser(params: any, token: string) {
        return this.inwuRequestApiService.get('/api/auth/user', params, token);
    }

    /**
    * 刷新token
    * @param param 
    */
    public refreshToken(params: any) {
        return this.inwuRequestApiService.post('/api/auth/token', params);
    }

   /**
    * 退出inwu平台
    * @param params 
    * @param token 
    * @returns 
    */
    public logout(params: any, token: string) {
        return this.inwuRequestApiService.post('/api/auth/logout', params, token);
    }


}
